package com.hyl.service;

import com.hyl.dao.SysRoleDao;
import com.hyl.entity.SysRole;
import com.hyl.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2023/3/31 10:58
 **/
public class SysRoleServiceImpl implements SysRoleService {

	SysRoleDao sysRoleDao ;

	public SysRoleServiceImpl(){
		SqlSession sqlSession = MyBatisUtil.createSqlSession();
		sysRoleDao = sqlSession.getMapper(SysRoleDao.class);
	}

	@Override
	public List<SysRole> findAll() {
		return sysRoleDao.findAll();
	}

	@Override
	public SysRole findById(Integer id) {
		return sysRoleDao.findById(id);
	}

	@Override
	public int update(SysRole role) {
		return sysRoleDao.update(role);
	}

	@Override
	public int del(Integer id) {
		return sysRoleDao.del(id);
	}

	@Override
	public int save(SysRole role) {
		return 0;
	}
}
